<%@ page language="java" import="java.util.*,com.hs.wdss.model.*,com.hs.core.cache.*" pageEncoding="utf-8"%>
<%
	WdssDisinfo obj = (WdssDisinfo)request.getAttribute("obj");
	String symStr30 = "";
	String symStr31 = "";
	String symStr32 = "";
	String symStr33 = "";
	String symStr34 = "";
	String symStr35 = "";
	String symStr36 = "";
	String symStr37 = "";
	String symStr38 = "";
	String symStr39 = "";
	String symStr40 = "";
	String symStr41 = "";
	String symStr42 = "";
	String symStr43 = "";
	String symStr44 = "";
	String symStr45 = "";
	String symStr46 = "";
	String symStr47 = "";
	String symStr48 = "";
	String symStr49 = "";
	if(obj != null && !obj.getPtomset().isEmpty()){
		Set ptomset = obj.getPtomset();
	    Iterator iter = ptomset.iterator();
	    while(iter.hasNext()){
	        WdssPtominfo ptom = (WdssPtominfo)iter.next();
	        String symtype = ptom.getSymtype()+"";
	        if("30".equals(symtype)){
	          	symStr30 = symStr30 + ptom.getSymcode() + ",";
	        }else if("31".equals(symtype)){
	        	symStr31 = symStr31 + ptom.getSymcode() + ",";
	        }else if("32".equals(symtype)){
	        	symStr32 = symStr32 + ptom.getSymcode() + ",";
	        }else if("33".equals(symtype)){
	        	symStr33 = symStr33 + ptom.getSymcode() + ",";
	        }else if("34".equals(symtype)){
	        	symStr34 = symStr34 + ptom.getSymcode() + ",";
	        }else if("35".equals(symtype)){
	        	symStr35 = symStr35 + ptom.getSymcode() + ",";
	        }else if("36".equals(symtype)){
	        	symStr36 = symStr36 + ptom.getSymcode() + ",";
	        }else if("37".equals(symtype)){
	        	symStr37 = symStr37 + ptom.getSymcode() + ",";
	        }else if("38".equals(symtype)){
	        	symStr38 = symStr38 + ptom.getSymcode() + ",";
	        }else if("39".equals(symtype)){
	        	symStr39 = symStr39 + ptom.getSymcode() + ",";
	        }else if("40".equals(symtype)){
	        	symStr40 = symStr40 + ptom.getSymcode() + ",";
	        }else if("41".equals(symtype)){
	        	symStr41 = symStr41 + ptom.getSymcode() + ",";
	        }else if("42".equals(symtype)){
	        	symStr42 = symStr42 + ptom.getSymcode() + ",";
	        }else if("43".equals(symtype)){
	        	symStr43 = symStr43 + ptom.getSymcode() + ",";
	        }else if("44".equals(symtype)){
	        	symStr44 = symStr44 + ptom.getSymcode() + ",";
	        }else if("45".equals(symtype)){
	        	symStr45 = symStr45 + ptom.getSymcode() + ",";
	        }else if("46".equals(symtype)){
	        	symStr46 = symStr46 + ptom.getSymcode() + ",";
	        }else if("47".equals(symtype)){
	        	symStr47 = symStr47 + ptom.getSymcode() + ",";
	        }else if("48".equals(symtype)){
	        	symStr48 = symStr48 + ptom.getSymcode() + ",";
	        }else if("49".equals(symtype)){
	        	symStr49 = symStr49 + ptom.getSymcode() + ",";
	        }
	    }        	
	}
	
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="../../include.jsp"%>  
<script src="<%=basePath %>app/javascripts/transform.js"></script>
<script src='<%=basePath%>dwr/interface/dataProhelper.js'></script>  
<script language="javascript" type="text/javascript">
function savedata()
{
	var wdssid = window.parent.datapromenu.document.all.wdssid.value;
	if(wdssid == ""){
		alert("请先保存医案信息！");	
		return;
	}else {
		var memo = document.getElementById("memo").value; 
		var symcode30obj = document.getElementsByName("symcode30"); 
	    var symcode30str = "";
	    for(var i=0;i<symcode30obj.length;i++){         
	      	if(symcode30obj[i].checked){   
	          	  symcode30str += symcode30obj[i].value+",";         
	        }         
	    }
	    var symcode31obj = document.getElementsByName("symcode31"); 
	    var symcode31str = "";
	    for(var i=0;i<symcode31obj.length;i++){         
	      	if(symcode31obj[i].checked){   
	          	  symcode31str += symcode31obj[i].value+",";         
	        }         
	    }
	    var symcode32obj = document.getElementsByName("symcode32"); 
	    var symcode32str = "";
	    for(var i=0;i<symcode32obj.length;i++){         
	      	if(symcode32obj[i].checked){   
	          	  symcode32str += symcode32obj[i].value+",";         
	        }         
	    }
	    var symcode33obj = document.getElementsByName("symcode33"); 
	    var symcode33str = "";
	    for(var i=0;i<symcode33obj.length;i++){         
	      	if(symcode33obj[i].checked){   
	          	  symcode33str += symcode33obj[i].value+",";         
	        }         
	    }
	    var symcode34obj = document.getElementsByName("symcode34"); 
	    var symcode34str = "";
	    for(var i=0;i<symcode34obj.length;i++){         
	      	if(symcode34obj[i].checked){   
	          	  symcode34str += symcode34obj[i].value+",";         
	        }         
	    }
	    var symcode35obj = document.getElementsByName("symcode35"); 
	    var symcode35str = "";
	    for(var i=0;i<symcode35obj.length;i++){         
	      	if(symcode35obj[i].checked){   
	          	  symcode35str += symcode35obj[i].value+",";         
	        }         
	    }
	    var symcode36obj = document.getElementsByName("symcode36"); 
	    var symcode36str = "";
	    for(var i=0;i<symcode36obj.length;i++){         
	      	if(symcode36obj[i].checked){   
	          	  symcode36str += symcode36obj[i].value+",";         
	        }         
	    }
	    var symcode37obj = document.getElementsByName("symcode37"); 
	    var symcode37str = "";
	    for(var i=0;i<symcode37obj.length;i++){         
	      	if(symcode37obj[i].checked){   
	          	  symcode37str += symcode37obj[i].value+",";         
	        }         
	    }
	    var symcode38obj = document.getElementsByName("symcode38"); 
	    var symcode38str = "";
	    for(var i=0;i<symcode38obj.length;i++){         
	      	if(symcode38obj[i].checked){   
	          	  symcode38str += symcode38obj[i].value+",";         
	        }         
	    }
	    var symcode39obj = document.getElementsByName("symcode39"); 
	    var symcode39str = "";
	    for(var i=0;i<symcode39obj.length;i++){         
	      	if(symcode39obj[i].checked){   
	          	  symcode39str += symcode39obj[i].value+",";         
	        }         
	    }
	    var symcode40obj = document.getElementsByName("symcode40"); 
	    var symcode40str = "";
	    for(var i=0;i<symcode40obj.length;i++){         
	      	if(symcode40obj[i].checked){   
	          	  symcode40str += symcode40obj[i].value+",";         
	        }         
	    }
	    var symcode41obj = document.getElementsByName("symcode41"); 
	    var symcode41str = "";
	    for(var i=0;i<symcode41obj.length;i++){         
	      	if(symcode41obj[i].checked){   
	          	  symcode41str += symcode41obj[i].value+",";         
	        }         
	    }
	    var symcode42obj = document.getElementsByName("symcode42"); 
	    var symcode42str = "";
	    for(var i=0;i<symcode42obj.length;i++){         
	      	if(symcode42obj[i].checked){   
	          	  symcode42str += symcode42obj[i].value+",";         
	        }         
	    }
	    var symcode43obj = document.getElementsByName("symcode43"); 
	    var symcode43str = "";
	    for(var i=0;i<symcode43obj.length;i++){         
	      	if(symcode43obj[i].checked){   
	          	  symcode43str += symcode43obj[i].value+",";         
	        }         
	    }
	    var symcode44obj = document.getElementsByName("symcode44"); 
	    var symcode44str = "";
	    for(var i=0;i<symcode44obj.length;i++){         
	      	if(symcode44obj[i].checked){   
	          	  symcode44str += symcode44obj[i].value+",";         
	        }         
	    }
	    var symcode45obj = document.getElementsByName("symcode45"); 
	    var symcode45str = "";
	    for(var i=0;i<symcode45obj.length;i++){         
	      	if(symcode45obj[i].checked){   
	          	  symcode45str += symcode45obj[i].value+",";         
	        }         
	    }
	    var symcode46obj = document.getElementsByName("symcode46"); 
	    var symcode46str = "";
	    for(var i=0;i<symcode46obj.length;i++){         
	      	if(symcode46obj[i].checked){   
	          	  symcode46str += symcode46obj[i].value+",";         
	        }         
	    }
	    var symcode47obj = document.getElementsByName("symcode47"); 
	    var symcode47str = "";
	    for(var i=0;i<symcode47obj.length;i++){         
	      	if(symcode47obj[i].checked){   
	          	  symcode47str += symcode47obj[i].value+",";         
	        }         
	    }
	    var symcode48obj = document.getElementsByName("symcode48"); 
	    var symcode48str = "";
	    for(var i=0;i<symcode48obj.length;i++){         
	      	if(symcode48obj[i].checked){   
	          	  symcode48str += symcode48obj[i].value+",";         
	        }         
	    }
	    var symcode49obj = document.getElementsByName("symcode49"); 
	    var symcode49str = "";
	    for(var i=0;i<symcode49obj.length;i++){         
	      	if(symcode49obj[i].checked){   
	          	  symcode49str += symcode49obj[i].value+",";         
	        }         
	    }
		if(isNull(symcode30str) && isNull(symcode31str)&& isNull(symcode31str)&& isNull(symcode32str)&& isNull(symcode33str)&& isNull(symcode34str)
		&& isNull(symcode35str)&& isNull(symcode36str)&& isNull(symcode37str)&& isNull(symcode38str)&& isNull(symcode39str)&& isNull(symcode40str)
		&& isNull(symcode41str)&& isNull(symcode42str)&& isNull(symcode43str)&& isNull(symcode44str)&& isNull(symcode45str)&& isNull(symcode46str)
		&& isNull(symcode47str)&& isNull(symcode48str)&& isNull(symcode49str)){
			alert("请选择症状！");
			return; 
   		}
   		var symcodestr = symcode30str + "#"+symcode31str+"#"+symcode32str+"#"+symcode33str+"#"+symcode34str+"#"+symcode35str+"#"+symcode36str+
   		"#"+symcode37str+"#"+symcode38str+"#"+symcode39str+"#"+symcode40str+"#"+symcode41str+"#"+symcode42str+"#"+symcode43str+"#"+symcode44str+
   		"#"+symcode45str+"#"+symcode46str+"#"+symcode47str+"#"+symcode48str+"#"+symcode49str;

	   	dataProhelper.addPtom(wdssid,memo,symcodestr,callback4addPtom);
	}
	
}
function callback4addPtom(message){ 
	if(message != null){
		 alert('症状信息保存成功！'); 
		 //刷新左边菜单
	 	var wdssid = window.parent.datapromenu.document.all.wdssid.value;
	 	window.parent.datapromenu.frameElement.src = "<%=basePath%>produce/datapromenu.do?wdssid="+wdssid;
	}
}
function backlist()
{
	window.parent.window.location.href = "<%=basePath%>produce/dataprolist.do"
}
function changevalue(data){
	var index = data.indexOf("_");
    var ptomname = data.substring(0,index);
    var ptomvalue = data.substring(index+1); 
    var wdssid = window.parent.datapromenu.document.all.wdssid.value;
	var obj = document.getElementById(data);
	if(obj.checked){
		dataProhelper.addPtomNew(wdssid,ptomname,ptomvalue,callback4addPtomNew);
	}else{
		dataProhelper.queryPtomNew(wdssid,ptomname,ptomvalue,callback4queryPtomNew);
	}
}
function callback4addPtomNew(message){ 
	if(message != null){
		// alert('症状信息保存成功！'); 
		 //刷新左边菜单
	 	var wdssid = window.parent.datapromenu.document.all.wdssid.value;
	 	window.parent.datapromenu.frameElement.src = "<%=basePath%>produce/datapromenu.do?wdssid="+wdssid;
	}
}
function callback4queryPtomNew(data){ 
	var index = data.indexOf("$");
	if(index == "-1"){
		dataProhelper.delPtom(data,callback4delPtom);
	}else{
		alert("请先删除该症状相关的证候信息！");
    	var ptomname = data.substring(0,index);
    	var ptomvalue = data.substring(index+1); 
    	var obj = document.getElementById("symcode" +ptomname + "_" + ptomvalue );
    	obj.checked = true;
		return; 
	} 
}
function callback4delPtom(data){   
	//刷新左边菜单
	 var wdssid = window.parent.datapromenu.document.all.wdssid.value;
	 window.parent.datapromenu.frameElement.src = "<%=basePath%>produce/datapromenu.do?wdssid="+wdssid;
	 alert("删除症状信息成功！");
}
</script>
</head>
<body scroll=yes>
<div class="current">当前位置：数据加工 &gt; 症状信息</div>
        <table border="0" cellspacing="0" cellpadding="0" class="news"> 
        
          <tr>
            <th width="25%"><font size=4><strong>神志异常</strong></font></th>
            <td><font size=4 color=red><strong><%out.print(DictCacheUtil.getInst().selectStrCheck("symcode30","width:100%",symStr30,"30",1,"changevalue"));%></strong></font>
           		 <input name="ptomid" type="hidden" value="<%=obj==null?"":obj.getId()%>"/>
            </td>
           </tr>
          <tr>
            <th ><font size=4><strong>胸腹不适</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode31","width:100%",symStr31,"31",1,"changevalue"));%></strong></font></td>
          </tr>
          <tr>
            <th ><font size=4><strong>齿</strong></font></th>
            <td> <font size=4 color=red><strong><%out.print(DictCacheUtil.getInst().selectStrCheck("symcode32","width:100%",symStr32,"32",1,"changevalue"));%></strong></font></td>
            </tr>
          <tr>
            <th ><font size=4><strong>汗出异常</strong></font></th>
            <td> <font size=4 color=red><strong><%out.print(DictCacheUtil.getInst().selectStrCheck("symcode33","width:100%",symStr33,"33",1,"changevalue"));%></strong></font></td>
          </tr>
          <tr>
            <th ><font size=4><strong>口渴</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode34","width:100%",symStr34,"34",1,"changevalue"));%></strong></font></td>
            </tr>
          <tr>
            <th ><font size=4><strong>厥脱</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode35","width:100%",symStr35,"35",1,"changevalue"));%></strong></font></td>
          </tr>
          <tr>
            <th ><font size=4><strong>痉</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode36","width:100%",symStr36,"36",1,"changevalue"));%></strong></font></td>
            </tr>
          <tr>
            <th ><font size=4><strong>消化系统证候</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode37","width:100%",symStr37,"37",1,"changevalue"));%></strong></font></td>
          </tr>
          <tr>
            <th ><font size=4><strong>白pei</strong></font></th>
            <td> <font size=4 color=red><strong><%out.print(DictCacheUtil.getInst().selectStrCheck("symcode38","width:100%",symStr38,"38",1,"changevalue"));%></strong></font></td>
            </tr>
          <tr>
            <th ><font size=4><strong>斑疹</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode39","width:100%",symStr39,"39",1,"changevalue"));%></strong></font></td>
          </tr>
          <tr>
            <th ><font size=4><strong>发热</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode40","width:100%",symStr40,"40",1,"changevalue"));%></strong></font></td>
            </tr>
          <tr>
            <th ><font size=4><strong>呕恶</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode41","width:100%",symStr41,"41",1,"changevalue"));%></strong></font></td>
          </tr>
          <tr>
            <th ><font size=4><strong>舌苔</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode42","width:100%",symStr42,"42",1,"changevalue"));%></strong></font></td>
            </tr>
          <tr>
            <th ><font size=4><strong>舌态</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode43","width:100%",symStr43,"43",1,"changevalue"));%></strong></font></td>
          </tr>
          <tr>
            <th ><font size=4><strong>舌质</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode44","width:100%",symStr44,"44",1,"changevalue"));%></strong></font></td>
            </tr>
          <tr>
            <th ><font size=4><strong>涕</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode46","width:100%",symStr46,"46",1,"changevalue"));%></strong></font></td>
          </tr>
          <tr>
            <th ><font size=4><strong>脉象</strong></font></th>
            <td><font size=4 color=red><strong> <%out.print(DictCacheUtil.getInst().selectStrCheck("symcode45","width:100%",symStr45,"45",1,"changevalue"));%></strong></font></td>
          </tr>
          <tr>
            <th ><font size=4><strong>咳嗽</strong></font></th>
            <td><font size=4 color=red><strong><%out.print(DictCacheUtil.getInst().selectStrCheck("symcode47","width:100%",symStr47,"47",1,"changevalue"));%></strong></font></td>
            </tr>
          <tr>
            <th ><font size=4><strong>痰</strong></font></th>
            <td ><font size=4 color=red><strong><%out.print(DictCacheUtil.getInst().selectStrCheck("symcode48","width:100%",symStr48,"48",1,"changevalue"));%></strong></font></td>
          </tr>
          <tr>
            <th><font size=4><strong>头痛</strong></font></th>
            <td><font size=4 color=red><strong><%out.print(DictCacheUtil.getInst().selectStrCheck("symcode49","width:100%",symStr49,"49",1,"changevalue"));%></strong></font></td>
          </tr>
          <!--tr>
           <td colspan=4 >
           		<input  type="button" value="保存" onclick="savedata();" class="butt"/>
           		<input  type="button" value="返回" onclick="backlist();" class="butt"/>
           </td>
          </tr-->
        </table> 
</body>
</html>


